<form class="form-horizontal" id="winModal">
    <input id="id" name="id" type="hidden" value="${merchant.id!}">
    <input id="itemType" name="itemType" type="hidden" value="${itemType!}">
    <div class="alert alert-danger" style="margin-bottom: 0">
        以下信息将会打印到营业执照上，请核对无误再提交
    </div>
    <hr>
    <div class="form-group">
        <label class="col-sm-3 control-label text-left">经营者：</label>
        <div class="col-sm-8">
            <input name="member" class="form-control" type="text" placeholder="请输入法定代表人" value="${member.name!}" required="required" disabled="disabled" readonly="readonly">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">名&emsp;&emsp;称：</label>
        <div class="col-sm-8">
            <input name="merchantName" class="form-control" type="text" placeholder="请输入商户名称" value="${merchant.merchantName!}" required="required" readonly="readonly">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">类&emsp;&emsp;型：</label>
        <div class="col-sm-8">
            <input name="certType" class="form-control" type="text" placeholder="请输入企业类型" value="${merchant.certType!'个体工商户'}" required="required">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">经营场所：</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="2" name="merchantAddress" placeholder="请输入住所" required="required">${merchant.merchantAddress!}</textarea>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">组成形式：</label>
        <div class="col-sm-8">
            <input name="businessForm" class="form-control" type="text" placeholder="请输入企业类型" value="${merchant.businessForm!'个人经营'}" required="required">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">注册日期：</label>
        <div class="col-sm-8">
            <input id="foundingTime" name="foundingTime" class="form-control" type="text" placeholder="请输入成立日期" value="${merchant.foundingTime,'yyyy-MM-dd'}" required="required" readonly="readonly">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">信用编码：</label>
        <div class="col-sm-8">
            <input name="merchantCode" class="form-control" type="text" placeholder="请输入统一社会信用编码" value="${merchant.merchantCode!}" required="required">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">二维码链接：</label>
        <div class="col-sm-8">
            <input class="form-control" name="qrcode" id="qrcode" type="url" placeholder="请输入二维码链接地址" value="${merchant.qrcode!}" required="required">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">经营范围：</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="5" name="businessScope" id="businessScope" placeholder="请输入经营范围" required="required">${merchant.businessScope}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">短信通知：</label>
        <div class="col-sm-8">
            <label class="control-label text text-danger font-noraml ">
                <input type="checkbox" id="sendSms" name="sendSms" value="1" checked="checked">&emsp;勾选后，将发送通知短信给经营者。</label>
        </div>
    </div>


</form>

<script type="text/javascript">
    //页面JS调用
    require(['bootstrapDatepicker','bootstrapDatepickerCN'], function () {
        //时间控件
        $('#foundingTime').datepicker({
            format: "yyyy-mm-dd",
            maxViewMode: 0,
            language: "zh-CN",
            keyboardNavigation: false,
            autoclose: true,
            todayHighlight: true
        });
    });
    //验证
    $(function () {
        var e = "<i class='fa fa-times-circle'></i>";
        $("#winModal").validate({
            rules: {
                merchantName: {
                    required: true,
                    rangelength: [10, 50],
                    stringZhCNName: true
                },
                merchantCode: {
                    required: true
                },
                certType: {
                    required: true
                },
                businessForm: {
                    required: true
                },
                merchantAddress: {
                    required: true
                },
                member: {
                    required: true
                },
                registeredCapital: {
                    required: true
                },
                qrcode: {
                    required: true
                },
                foundingTime: {
                    required: true
                },
                busnissTime: {
                    required: true
                },
                businessScope: {
                    required: true
                }
            },
            messages: {       //自定义验证消息
                merchantName: {
                    required: e + "商户名称不能为空！",
                    stringZhCNName: e + "只能包含汉字。",
                    rangelength: $.validator.format(e + "商户名称要在{0}-{1}个汉字之间。")
                },
                merchantCode: {
                    required: e + "统一社会信用编码不能为空！"
                },
                certType: {
                    required: e + "商户类型不能为空！"
                },
                businessForm: {
                    required: e + "组成形式不能为空！"
                },
                merchantAddress: {
                    required: e + "商户住所不能为空！"
                },
                member: {
                    required: e + "商户经营者不能为空！"
                },
                qrcode: {
                    required: e + "营业执照的二维码链接不能为空！",
                    url: e + "二维码链接地址错误"
                },
                registeredCapital: {
                    required: e + "资金数额不能为空！"
                },
                foundingTime: {
                    required: e + "成立时间不能为空！"
                },
                busnissTime: {
                    required: e + "经营期限不能为空！"
                },
                businessScope: {
                    required: e + "经营范围不能为空！"
                }
            }
        });
    });
</script>